WIFI_ATBM6062CU_SITE_METHOD = git
WIFI_ATBM6062CU_SITE = https://github.com/wltechblog/unfortunateblobs
WIFI_ATBM6062CU_SITE_BRANCH = main
WIFI_ATBM6062CU_VERSION = 2d20f54875e34be8e62713c4cd62f7202a622c8a

WIFI_ATBM6062CU_LICENSE = GPL-2.0

ATBM6062CU_MODULE_NAME = "atbm6062cu"

define WIFI_ATBM6062CU_LINUX_CONFIG_FIXUPS
	$(call KCONFIG_ENABLE_OPT,CONFIG_WLAN)
	$(call KCONFIG_ENABLE_OPT,CONFIG_BUG)
	$(call KCONFIG_ENABLE_OPT,CONFIG_TRACING)
	$(call KCONFIG_ENABLE_OPT,CONFIG_PRINTK)
	$(call KCONFIG_ENABLE_OPT,CONFIG_DEBUG_KERNEL)
	$(call KCONFIG_ENABLE_OPT,CONFIG_WIRELESS)
	$(call KCONFIG_ENABLE_OPT,CONFIG_WIRELESS_EXT)
	$(call KCONFIG_ENABLE_OPT,CONFIG_WEXT_CORE)
	$(call KCONFIG_ENABLE_OPT,CONFIG_WEXT_PROC)
	$(call KCONFIG_ENABLE_OPT,CONFIG_WEXT_PRIV)
	$(call KCONFIG_ENABLE_OPT,CONFIG_CFG80211)
	$(call KCONFIG_ENABLE_OPT,CONFIG_MAC80211)
	$(call KCONFIG_DISABLE_OPT,CONFIG_DYNAMIC_DEBUG)
endef

LINUX_CONFIG_LOCALVERSION = $(shell awk -F "=" '/^CONFIG_LOCALVERSION=/ {print $$2}' $(BR2_LINUX_KERNEL_CUSTOM_CONFIG_FILE))

define WIFI_ATBM6062CU_INSTALL_MODULE
	$(INSTALL) -m 0755 -d $(TARGET_DIR)/lib/modules/3.10.14$(LINUX_CONFIG_LOCALVERSION)
	$(INSTALL) -m 0755 -t $(TARGET_DIR)/lib/modules/3.10.14$(LINUX_CONFIG_LOCALVERSION) $(WIFI_ATBM6062CU_BUILDDIR)/atbm6062cu.ko
	$(INSTALL) -m 0755 -t $(TARGET_DIR)/bin $(WIFI_ATBM6062CU_PKGDIR)/files/rename-wifi.sh
	touch $(TARGET_DIR)/lib/modules/3.10.14$(LINUX_CONFIG_LOCALVERSION)/modules.builtin.modinfo
endef

WIFI_ATBM6062CU_POST_INSTALL_TARGET_HOOKS += WIFI_ATBM6062CU_INSTALL_MODULE


$(eval $(generic-package))
